using System;

namespace SerialTool.Models;

public enum LogMessageDirection
{
    Sent,
    Received
}

public class LogMessage
{
    public DateTime Timestamp { get; } = DateTime.Now;
    public LogMessageDirection Direction { get; set; }
    public string Content { get; set; } = string.Empty;
    public byte[]? RawBytes { get; set; } // 可选，用于详细查看
    public string DisplayContent => $"[{Timestamp:HH:mm:ss.fff}] {(Direction == LogMessageDirection.Sent ? "TX >" : "RX <")} {Content}";

    // 构造函数可以根据需要添加
} 